// pages/index/index.js
Page({
  data: {
    currentTab: 0,
    introduce_su7: [
      {
        id: 1,
        image:
          'https://bangke-wen.oss-cn-hangzhou.aliyuncs.com/wxapp_image/su7_m_01.jpg',
      },
      {
        id: 2,
        image:
          'https://bangke-wen.oss-cn-hangzhou.aliyuncs.com/wxapp_image/su7_m_02.jpg',
      },
    ],
    introduce_su7_s: [
      {
        id: 1,
        image_1:
          'https://bangke-wen.oss-cn-hangzhou.aliyuncs.com/wxapp_image/su7_s_2.jpg',
        image_2:
          'https://bangke-wen.oss-cn-hangzhou.aliyuncs.com/wxapp_image/su7_s_1.jpg',
        image_3:
          'https://bangke-wen.oss-cn-hangzhou.aliyuncs.com/wxapp_image/su7_s_3.jpg',
      },
    ],
  },

  onTabClick: function (e) {
    this.setData({
      currentTab: e.currentTarget.dataset.index,
    });
  },

  onSwiperChange: function (e) {
    this.setData({
      currentTab: e.detail.current,
    });
  },

  goToTestDrivePage() {
    wx.navigateTo({
      url: '/pages/testDrive/testDrive',
    });
  },

  goToBuyPage() {
    wx.navigateTo({
      url: '/pages/buyCar/buyCar',
    });
  },
});
